package com.winter.Controller;

import com.winter.model.FinCommentInfo;
import com.winter.service.FinCommentInfoService;
import com.winter.util.Result;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 评论
 */
@RestController
@RequestMapping("v1/comment")
class FinCommentInfoController {

    @Autowired
    public FinCommentInfoService finCommentInfoService;

    /**
     * 评论列表
     */
    @GetMapping
    public Result commentList(Long id, Integer relaType, Integer relaChildType, Integer pageSize, Integer pageNumber) {
        return finCommentInfoService.commentList(id, relaType, relaChildType, pageSize, pageNumber);

    }

    /**
     * 新增评论
     */
    @PostMapping
    public Result insertComment(@RequestBody FinCommentInfo finCommentInfo) {

        return finCommentInfoService.insertComment(finCommentInfo);
    }


}
